import {
  Button,
  Col,
  Form,
  FormItem,
  Input,
  InputNumber,
  message,
  Modal,
  Radio,
  RadioGroup,
  Row,
  Select,
  SelectOption,
  Spin,
  Textarea
} from 'ant-design-vue'
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'

import { companyApi, riverApi, xhImformationApi } from '@/apis'
import { OrderDetailItem } from '@/apis/orderTypes'
import { addDivisionItem, ServiceData } from '@/apis/riverTypes'
import { useBack } from '@/hooks/useBack'
import { formatDate } from '@/utils'
import { handlePrice } from '@/utils/bsshow'
import { debounce } from '@/utils/throttle'

export default defineComponent({
  name: 'EditInformation',
  setup() {
    const data1 = ref({} as ServiceData)
    const route = useRoute()
    const router = useRouter()
    const selectParentName = ref()
    const BusinessName = ref()
    const selectCompanyId = ref()
    const selectCompanyId2 = ref('暂无')
    const selectCompanyId3 = ref('暂无')
    const selectserviceProviderId = ref()
    const data = ref({} as any[])
    const getList = ref([] as any[])
    const showDialog = ref(false)
    const dialogLoading = ref(false)
    const editList = ref()
    const loading = ref(false)
    const showRefundDlg = ref(false)
    const refundDlgLoading = ref(false)
    const nameList1 = ref([] as any[])
    const nameList2 = ref([] as any[])
    const nameList3 = ref([] as any[])
    const nameList4 = ref([] as any[])
    const addCur = ref({} as addDivisionItem)
    const sid = ref()
    const salesCompanyNum = ref(0)
    const showDialog1 = ref(false)
    const showDialog2 = ref(false)
    const dialogLoading1 = ref(false)
    const dialogLoading2 = ref(false)
    //列表字段
    const accountName = ref()
    const combatTeam = ref()
    const groupNumber = ref()
    const roleName = ref()
    const id = ref()
    const memoOne = ref()
    const memoThree = ref()
    const memoTwo = ref()
    const mobile = ref()
    const overquotaOrNot = ref()
    const parentId = ref()
    const businessDivisionId = ref()
    const newBusinessDivisionId = ref()
    const newMemberId = ref()
    const businessDivisionName = ref()
    const positionLevel = ref()
    const presidentStarRating = ref(0)
    const salesCompanyId = ref()
    const salesCompanyStatus = ref()
    const isShowSettlememt = ref()
    const globalIsShow = ref()
    const serviceProviderId = ref()
    const serviceProviderLevel = ref()
    const headOfficeId = ref()
    const serviceProviderType = ref(0)
    const mostManageCompanCnt = ref()
    const status = ref()
    const isPreview = ref(false)
    watch(
      () => router.currentRoute.value.path,
      async (newValue, oldValue) => {
        editList.value = route.query.id
        if (
          editList.value != null &&
          newValue == '/river/supplierManage/editInformation'
        ) {
          if (data.value) {
            data.value = await xhImformationApi.getDetail(route.query.id)
            accountName.value = data.value.accountName
            mostManageCompanCnt.value = data.value.mostManageCompanCnt
            id.value = data.value.id
            selectParentName.value = data.value.parentName
            mobile.value = data.value.mobile
            combatTeam.value = data.value.combatTeam
            selectCompanyId.value = data.value.funame
            selectCompanyId2.value = data.value.businessDivisionName
            selectCompanyId3.value = data.value.roleName
            groupNumber.value = data.value.groupNumber
            memoOne.value = data.value.memoOne
            memoThree.value = data.value.memoThree
            memoTwo.value = data.value.memoTwo
            overquotaOrNot.value = data.value.overquotaOrNot
            positionLevel.value = data.value.positionLevel
            presidentStarRating.value = data.value.presidentStarRating
            serviceProviderId.value = data.value.serviceProviderId
            serviceProviderLevel.value = data.value.serviceProviderLevel
            headOfficeId.value = data.value.headOfficeId
            serviceProviderType.value = data.value.serviceProviderType
            selectserviceProviderId.value = data.value.corporateName
            salesCompanyStatus.value = data.value.salesCompanStatus
            globalIsShow.value = data.value.globalIsShow
            isShowSettlememt.value = data.value.isShowSettlememt
            accountName.value = data.value.accountName
            status.value = data.value.status
            parentId.value = data.value.parentId
            businessDivisionId.value = data.value.businessDivisionId
            newBusinessDivisionId.value = data.value.businessDivisionId
            newMemberId.value = data.value.newMemberId
            businessDivisionName.value = data.value.businessDivisionName
            salesCompanyId.value = data.value.salesCompanyId
          }
        }
      },
      { immediate: true }
    )

    const { handleCancel } = useBack('refreshFormationList')
    function cancel() {
      handleCancel()
    }
    onMounted(() => {
      getDetail()
    })
    async function getDetail() {
      try {
        loading.value = true
        data1.value = await riverApi.getConfigurationiOInformation()
      } finally {
        loading.value = false
      }
    }

    //判断销售公司数量
    function companyNum() {
      if (presidentStarRating.value != 0) {
        switch (presidentStarRating.value) {
          case 0:
            salesCompanyNum.value = data1.value.zeroPresident
            break
          case 1:
            salesCompanyNum.value = data1.value.onePresident
            break
          case 2:
            salesCompanyNum.value = data1.value.twoPresident
            break
          case 3:
            salesCompanyNum.value = data1.value.threePresident
            break
          case 4:
            salesCompanyNum.value = data1.value.fourPresident
            break
          case 5:
            salesCompanyNum.value = data1.value.fivePresident
            break
        }
      } else {
        switch (serviceProviderType.value) {
          case 0:
            salesCompanyNum.value = data1.value.zeroPresident
            break
          case 1:
            salesCompanyNum.value = data1.value.reserveServer
            break
          case 2:
            salesCompanyNum.value = data1.value.officialServer
            break
        }
      }
    }
    const mutexFlag = ref(0)
    // 判断互斥
    function mutexPrompt() {
      const arr = [
        { presidentStarRating: presidentStarRating.value },
        { serviceProviderType: serviceProviderType.value },
        { businessDivisionId: businessDivisionId.value },
        { headOfficeId: headOfficeId.value } as any
      ]
      console.log(arr)
      let flag = 0
      for (const newarr of arr) {
        if (newarr.presidentStarRating > 0) {
          flag = flag + 1
        }
        if (newarr.serviceProviderType > 0) {
          flag = flag + 1
        }
        if (newarr.businessDivisionId != null) {
          flag = flag + 1
        }
        if (newarr.headOfficeId != null) {
          flag = flag + 1
        }
      }
      if (flag >= 2) {
        mutexFlag.value = 2
      } else {
        mutexFlag.value = 1
      }
    }

    //弹窗编辑或新增
    async function ok() {
      showDialog2.value = false
      mutexPrompt()
      companyNum()
      if (mutexFlag.value === 1 && showDialog2.value === false) {
        try {
          if (editList.value == null) {
            await xhImformationApi
              .addImformation({
                accountName: accountName.value,
                combatTeam: combatTeam.value,
                groupNumber: groupNumber.value,
                id: id.value,
                memoOne: memoOne.value,
                memoThree: memoThree.value,
                memoTwo: memoTwo.value,
                mobile: mobile.value,
                overquotaOrNot: overquotaOrNot.value,
                parentId: parentId.value,
                businessDivisionId: businessDivisionId.value,
                newBusinessDivisionId: newBusinessDivisionId.value,
                newMemberId: newMemberId.value,
                businessDivisionName: businessDivisionName.value,
                positionLevel: positionLevel.value,
                presidentStarRating: presidentStarRating.value,
                salesCompanyId: salesCompanyId.value,
                salesCompanyStatus: salesCompanyStatus.value,
                isShowSettlememt: isShowSettlememt.value,
                serviceProviderId: serviceProviderId.value,
                serviceProviderLevel: serviceProviderLevel.value,
                headOfficeId: headOfficeId.value,
                serviceProviderType: serviceProviderType.value,
                status: status.value,
                mostManageCompanCnt: mostManageCompanCnt.value
              })
              .then(() => {
                handleCancel()
              })
          } else {
            await xhImformationApi
              .editImformation({
                accountName: accountName.value,
                combatTeam: combatTeam.value,
                groupNumber: groupNumber.value,
                id: id.value,
                memoOne: memoOne.value,
                memoThree: memoThree.value,
                memoTwo: memoTwo.value,
                mobile: mobile.value,
                overquotaOrNot: overquotaOrNot.value,
                parentId: parentId.value,
                businessDivisionId: businessDivisionId.value,
                newBusinessDivisionId: newBusinessDivisionId.value,
                newMemberId: newMemberId.value,
                businessDivisionName: businessDivisionName.value,
                positionLevel: positionLevel.value,
                presidentStarRating: presidentStarRating.value,
                salesCompanyId: salesCompanyId.value,
                salesCompanyStatus: salesCompanyStatus.value,
                isShowSettlememt: isShowSettlememt.value,
                serviceProviderId: serviceProviderId.value,
                serviceProviderLevel: serviceProviderLevel.value,
                headOfficeId: headOfficeId.value,
                serviceProviderType: serviceProviderType.value,
                status: status.value,
                mostManageCompanCnt: mostManageCompanCnt.value
              })
              .then(() => {
                handleCancel()
              })
          }
        } finally {
        }
      }
      if (mutexFlag.value === 2) {
        showDialog1.value = true
      }
    }
    //编辑或新增
    async function saveInformation() {
      mutexPrompt()
      companyNum()
      if (salesCompanyNum.value != mostManageCompanCnt.value) {
        showDialog2.value = true
      }
      if (mutexFlag.value === 1 && showDialog2.value === false) {
        try {
          if (editList.value == null) {
            await xhImformationApi
              .addImformation({
                accountName: accountName.value,
                combatTeam: combatTeam.value,
                groupNumber: groupNumber.value,
                id: id.value,
                memoOne: memoOne.value,
                memoThree: memoThree.value,
                memoTwo: memoTwo.value,
                mobile: mobile.value,
                overquotaOrNot: overquotaOrNot.value,
                parentId: parentId.value,
                businessDivisionId: businessDivisionId.value,
                newBusinessDivisionId: newBusinessDivisionId.value,
                newMemberId: newMemberId.value,
                businessDivisionName: businessDivisionName.value,
                positionLevel: positionLevel.value,
                presidentStarRating: presidentStarRating.value,
                salesCompanyId: salesCompanyId.value,
                salesCompanyStatus: salesCompanyStatus.value,
                isShowSettlememt: isShowSettlememt.value,
                serviceProviderId: serviceProviderId.value,
                serviceProviderLevel: serviceProviderLevel.value,
                headOfficeId: headOfficeId.value,
                serviceProviderType: serviceProviderType.value,
                status: status.value,
                mostManageCompanCnt: mostManageCompanCnt.value
              })
              .then(() => {
                handleCancel()
              })
          } else {
            await xhImformationApi
              .editImformation({
                accountName: accountName.value,
                combatTeam: combatTeam.value,
                groupNumber: groupNumber.value,
                id: id.value,
                memoOne: memoOne.value,
                memoThree: memoThree.value,
                memoTwo: memoTwo.value,
                mobile: mobile.value,
                overquotaOrNot: overquotaOrNot.value,
                parentId: parentId.value,
                businessDivisionId: businessDivisionId.value,
                newBusinessDivisionId: newBusinessDivisionId.value,
                newMemberId: newMemberId.value,
                businessDivisionName: businessDivisionName.value,
                positionLevel: positionLevel.value,
                presidentStarRating: presidentStarRating.value,
                salesCompanyId: salesCompanyId.value,
                salesCompanyStatus: salesCompanyStatus.value,
                isShowSettlememt: isShowSettlememt.value,
                serviceProviderId: serviceProviderId.value,
                serviceProviderLevel: serviceProviderLevel.value,
                headOfficeId: headOfficeId.value,
                serviceProviderType: serviceProviderType.value,
                status: status.value,
                mostManageCompanCnt: mostManageCompanCnt.value
              })
              .then(() => {
                handleCancel()
              })
          }
        } finally {
        }
      }
      if (mutexFlag.value === 2) {
        showDialog1.value = true
      }
    }
    function test1(item) {
      debounce(async () => {
        try {
          const namelistarr = await xhImformationApi.getParentName({
            accountName: item
          })
          nameList1.value = namelistarr.dataList
        } finally {
        }
      })
    }
    //查询所有事业部
    function groupList(item) {
      debounce(async () => {
        try {
          const namelistarr = await xhImformationApi.selectDivisionName({
            businessDivisionName: item
          })
          nameList4.value = namelistarr
        } finally {
        }
      })
    }
    //查询所有总部
    function groupList1(item) {
      debounce(async () => {
        try {
          const namelistarr = await xhImformationApi.selectHeadDivisionName({
            roleName: item
          })
          nameList4.value = namelistarr
        } finally {
        }
      })
    }
    function selectId1(value) {
      parentId.value = value
    }
    // 判断服务商级别
    function isDisabledLevel() {
      if (serviceProviderType.value == 0) {
        serviceProviderLevel.value = 0
        return true
      } else {
        return false
      }
    }

    function test2(item) {
      debounce(async () => {
        try {
          const namelistarr = await companyApi.getCompanyList({
            funame: item
          })
          nameList2.value = namelistarr.dataList
        } finally {
        }
      })
    }
    function selectId2(value) {
      salesCompanyId.value = value
      dialogLoading.value
    }
    async function test3(item) {
      debounce(async () => {
        try {
          const namelistarr = await riverApi.getSupplierList({
            corporateName: item
          })
          nameList3.value = namelistarr.dataList
        } finally {
        }
      })
    }
    function selectId3(value) {
      serviceProviderId.value = value
    }
    function selectId4(value) {
      newBusinessDivisionId.value = value
    }
    function selectId5(value) {
      headOfficeId.value = value
    }
    function selectLevel(level) {
      if (level === 0) {
        return '暂无'
      }
      if (level === 1) {
        return '群主'
      }
      if (level === 2) {
        return '副群主'
      }
      if (level === 3) {
        return '预备群主'
      }
      if (level === 4) {
        return '预备副群主'
      }
      if (level === 5) {
        return '考核预备群主'
      }
      if (level === 6) {
        return '考核预备副群主'
      }
    }
    function selcettype(type) {
      if (type === 0) {
        return '暂无'
      }
      if (type === 1) {
        return '预备'
      }
      if (type === 2) {
        return '正式'
      }
    }
    function clear1() {
      parentId.value = null
    }
    function clear2() {
      salesCompanyId.value = null
    }
    function clear3() {
      serviceProviderId.value = null
    }
    function clear4() {
      businessDivisionId.value = null
    }
    function clear5() {
      headOfficeId.value = null
    }
    function btcancel1() {
      showDialog1.value = false
      showDialog2.value = false
    }
    //弹窗判断
    async function btcancel2() {
      showDialog2.value = false
    }
    const rulesRef = ref({
      accountName: [
        { required: true, message: '请输入账号名称', trigger: 'blur' }
      ],
      mobile: [{ required: true, message: '手机号', trigger: 'blur' }]
    } as FormRules)
    return {
      salesCompanyNum,
      mutexFlag,
      showDialog1,
      showDialog2,
      dialogLoading1,
      dialogLoading2,
      selectserviceProviderId,
      selectParentName,
      BusinessName,
      getList,
      editList,
      nameList1,
      nameList2,
      nameList3,
      nameList4,
      data,
      sid,
      showRefundDlg,
      refundDlgLoading,
      loading,
      salesCompanyId,
      selectCompanyId,
      selectCompanyId2,
      selectCompanyId3,
      salesCompanyStatus,
      isShowSettlememt,
      status,
      parentId,
      businessDivisionId,
      newBusinessDivisionId,
      newMemberId,
      serviceProviderId,
      serviceProviderLevel,
      businessDivisionName,
      headOfficeId,
      serviceProviderType,
      accountName,
      combatTeam,
      groupNumber,
      showDialog,
      dialogLoading,
      id,
      memoOne,
      memoThree,
      memoTwo,
      mostManageCompanCnt,
      mobile,
      overquotaOrNot,
      presidentStarRating,
      positionLevel,
      rulesRef,
      globalIsShow,
      isDisabledLevel,
      ok,
      selectLevel,
      mutexPrompt,
      saveInformation,
      selcettype,
      test1,
      groupList,
      groupList1,
      test3,
      getDetail,
      clear1,
      clear4,
      clear5,
      clear2,
      clear3,
      cancel,
      btcancel1,
      btcancel2,
      selectId1,
      test2,
      selectId2,
      selectId3,
      selectId4,
      selectId5
    }
  },
  render() {
    return (
      <Spin spinning={this.loading}>
        <Form onSubmit={this.saveInformation} labelCol={{ span: 8 }}>
          <Row
            type="flex"
            style={{
              marginTop: '10px',
              marginRight: '50px',
              borderBottom: '1px solid 	#F5F5F5'
            }}
            gutter={[8, 16]}
          >
            <Col span={7}>
              <FormItem
                label="基本账号姓名："
                rules={this.rulesRef.accountName}
              >
                <Input
                  placeholder="请输入"
                  v-model:value={this.accountName}
                  style="width:200px"
                  rules="[{ required: true, message: 'Please input your username!' }]"
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="基本账号ID：" required>
                <Input disabled v-model:value={this.id} style="width:200px" />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="登录手机号：" rules={this.rulesRef.mobile}>
                <Input
                  maxlength={11}
                  placeholder="请输入"
                  v-model:value={this.mobile}
                  style="width:200px"
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="上级姓名：">
                <Select
                  filterOption={false}
                  showSearch={true}
                  value={this.selectParentName}
                  placeholder="请输入"
                  onClear={this.clear1}
                  option-label-prop="label"
                  style="width: 200px"
                  dropdownMatchSelectWidth={false}
                  onSearch={num => this.test1(num)}
                  onChange={this.selectId1}
                  allowClear
                >
                  {this.nameList1.map(v => (
                    <SelectOption value={v.id} label={v.accountName}>
                      {`${v.accountName} ${this.selectLevel(v.positionLevel)}
                      ${v.combatTeam || ''}
                      ${v.serviceProviderName || ''}
                      ${this.selcettype(v.serviceProviderType) || ''}`}
                    </SelectOption>
                  ))}
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="战队：">
                <Input
                  placeholder="请输入"
                  v-model:value={this.combatTeam}
                  style="width:200px"
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="服务商星级：">
                <Select
                  disabled={this.isDisabledLevel()}
                  onChange={this.isDisabledLevel}
                  placeholder="请输入"
                  v-model:value={this.serviceProviderLevel}
                  style="width:200px"
                >
                  <SelectOption value={1}>一星</SelectOption>
                  <SelectOption value={2}>二星</SelectOption>
                  <SelectOption value={3}>三星</SelectOption>
                  <SelectOption value={4}>四星</SelectOption>
                  <SelectOption value={5}>五星</SelectOption>
                  <SelectOption value={0}>暂无</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="职位：">
                <Select
                  placeholder="职位"
                  v-model:value={this.positionLevel}
                  style="width:200px"
                >
                  <SelectOption value={1}>群主</SelectOption>
                  <SelectOption value={2}>副群主</SelectOption>
                  <SelectOption value={3}>预备群主</SelectOption>
                  <SelectOption value={4}>预备副群主</SelectOption>
                  <SelectOption value={5}>考核预备群主</SelectOption>
                  <SelectOption value={6}>考核预备副群主</SelectOption>
                  <SelectOption value={0}>暂无</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="账号状态：">
                <Select
                  placeholder="请选择"
                  v-model:value={this.status}
                  style="width:200px"
                >
                  <SelectOption value={0}>正常</SelectOption>
                  <SelectOption value={1}>冻结</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={7} v-show={this.editList}>
              <FormItem label="所属事业部：">
                <Select
                  filterOption={false}
                  showSearch={true}
                  placeholder="请输入"
                  onClear={this.clear4}
                  option-label-prop="label"
                  style="width: 200px"
                  value={this.selectCompanyId2}
                  dropdownMatchSelectWidth={false}
                  onSearch={num => this.groupList(num)}
                  onChange={this.selectId4}
                  allowClear
                >
                  {this.nameList4.map(v => (
                    <SelectOption
                      value={v.businessDivisionId}
                      label={v.businessDivisionName}
                    >
                      {v.businessDivisionName}
                    </SelectOption>
                  ))}
                </Select>
              </FormItem>
            </Col>
          </Row>
          <Row
            type="flex"
            style={{
              marginTop: '30px',
              marginRight: '50px',
              borderBottom: '1px solid 	#F5F5F5'
            }}
            gutter={[8, 16]}
          >
            <Col span={7}>
              <FormItem label="销售公司名称：">
                <Select
                  allowClear
                  showSearch={true}
                  filterOption={false}
                  value={this.selectCompanyId}
                  placeholder="请输入"
                  style="width: 200px"
                  dropdownMatchSelectWidth={false}
                  option-label-prop="label"
                  onSearch={num => this.test2(num)}
                  onClear={this.clear2}
                  onChange={this.selectId2}
                >
                  {this.nameList2.map(v => (
                    <SelectOption value={v.id} label={v.funame}>
                      {v.funame}
                    </SelectOption>
                  ))}
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="销售公司状态：">
                <Select
                  placeholder="请选择"
                  style="width:200px"
                  v-model:value={this.salesCompanyStatus}
                >
                  <SelectOption value={1}>已开通</SelectOption>
                  <SelectOption value={2}>已停业</SelectOption>
                  <SelectOption value={0}>开通中</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={8}>
              <FormItem
                label="结算单明细是否展示"
                labelAlign="left"
                labelCol={{ span: 8 }}
              >
                <RadioGroup
                  disabled={this.globalIsShow == false}
                  v-model:value={this.isShowSettlememt}
                  style={{ width: '150px' }}
                >
                  <Radio value={false}>隐藏</Radio>
                  <Radio value={true}>展示</Radio>
                </RadioGroup>
              </FormItem>
            </Col>
            <Col span={7} v-show={this.editList}>
              <FormItem label="所属总部">
                <Select
                  filterOption={false}
                  showSearch={true}
                  placeholder="请输入"
                  onClear={this.clear5}
                  option-label-prop="label"
                  style="width: 200px"
                  value={this.selectCompanyId3}
                  dropdownMatchSelectWidth={false}
                  onSearch={num => this.groupList1(num)}
                  onChange={this.selectId5}
                  allowClear
                >
                  {this.nameList4.map(v => (
                    <SelectOption value={v.headOfficeId} label={v.roleName}>
                      {v.roleName}
                    </SelectOption>
                  ))}
                </Select>
              </FormItem>
            </Col>
          </Row>
          <Row
            type="flex"
            style={{
              marginTop: '30px',
              marginRight: '50px'
            }}
            gutter={[8, 16]}
          >
            <Col span={7}>
              <FormItem label="是否超名额：">
                <Input
                  placeholder="请输入"
                  style="width:200px"
                  v-model:value={this.overquotaOrNot}
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="群号：">
                <Select
                  disabled={this.presidentStarRating == 0}
                  placeholder="请选择"
                  v-model:value={this.groupNumber}
                  style="width:200px"
                >
                  <SelectOption value={1}>1</SelectOption>
                  <SelectOption value={2}>2</SelectOption>
                  <SelectOption value={3}>3</SelectOption>
                  <SelectOption value={4}>4</SelectOption>
                  <SelectOption value={5}>5</SelectOption>
                  <SelectOption value={6}>6</SelectOption>
                  <SelectOption value={7}>7</SelectOption>
                  <SelectOption value={8}>8</SelectOption>
                  <SelectOption value={9}>9</SelectOption>
                  <SelectOption value={10}>10</SelectOption>
                  <SelectOption value={11}>11</SelectOption>
                  <SelectOption value={12}>12</SelectOption>
                  <SelectOption value={13}>13</SelectOption>
                  <SelectOption value={14}>14</SelectOption>
                  <SelectOption value={15}>15</SelectOption>
                  <SelectOption value={16}>16</SelectOption>
                  <SelectOption value={17}>17</SelectOption>
                  <SelectOption value={18}>18</SelectOption>
                  <SelectOption value={19}>19</SelectOption>
                  <SelectOption value={20}>20</SelectOption>
                  <SelectOption value={21}>21</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="总裁星级：">
                <Select
                  placeholder="账号状态"
                  v-model:value={this.presidentStarRating}
                  style="width:200px"
                >
                  <SelectOption value={0}>暂无</SelectOption>
                  <SelectOption value={10}>零星</SelectOption>
                  <SelectOption value={1}>一星</SelectOption>
                  <SelectOption value={2}>二星</SelectOption>
                  <SelectOption value={3}>三星</SelectOption>
                  <SelectOption value={4}>四星</SelectOption>
                  <SelectOption value={5}>五星</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="服务商类型：">
                <Select
                  placeholder="账号状态"
                  v-model:value={this.serviceProviderType}
                  style="width:200px"
                >
                  <SelectOption value={1}>预备</SelectOption>
                  <SelectOption value={2}>正式</SelectOption>
                  <SelectOption value={0}>暂无</SelectOption>
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="服务商审核资料：">
                <Select
                  filterOption={false}
                  showSearch={true}
                  value={this.selectserviceProviderId}
                  placeholder="请输入"
                  option-label-prop="label"
                  style="width: 200px"
                  dropdownMatchSelectWidth={false}
                  onSearch={num => this.test3(num)}
                  onChange={this.selectId3}
                  onClear={this.clear3}
                  allowClear
                >
                  {this.nameList3.map(v => (
                    <SelectOption value={v.id} label={v.corporateName}>
                      {v.corporateName}
                    </SelectOption>
                  ))}
                </Select>
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="最多可管理公司数">
                <InputNumber
                  v-model:value={this.mostManageCompanCnt}
                  placeholder="请输入"
                  min={0}
                  max={10000}
                  precision={0}
                  style={{ width: '200px' }}
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="备注1：">
                <Textarea
                  placeholder="请输入"
                  v-model:value={this.memoOne}
                  maxLength="200"
                  style={{ width: '200px', height: '60px' }}
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="备注2：">
                <Textarea
                  placeholder="请输入"
                  v-model:value={this.memoTwo}
                  maxLength="200"
                  style={{ width: '200px', height: '60px' }}
                />
              </FormItem>
            </Col>
            <Col span={7}>
              <FormItem label="备注3：">
                <Textarea
                  placeholder="请输入"
                  v-model:value={this.memoThree}
                  maxLength="200"
                  style={{ width: '200px', height: '60px' }}
                />
              </FormItem>
            </Col>
          </Row>
          <FormItem>
            <Button
              style={{
                marginLeft: '600px',
                marginTop: '20px',
                marginRight: '20px'
              }}
              onClick={() => this.cancel()}
            >
              取消
            </Button>
            <Button type="primary" onClick={() => this.saveInformation()}>
              {this.editList ? '保存' : '确定'}
            </Button>
          </FormItem>
        </Form>
        <Modal
          v-model:visible={this.showDialog2}
          confirmLoading={this.dialogLoading2}
          width={350}
          title={'提示'}
          okText={'保存'}
          onOk={() => this.ok()}
        >
          系统默认设置的最多可管理公司数为：{this.salesCompanyNum}
          ,当前填写的为：
          {this.mostManageCompanCnt}，请仔细确认。
        </Modal>
        <Modal
          v-model:visible={this.showDialog1}
          confirmLoading={this.dialogLoading1}
          width={350}
          title={'提示'}
          footer={[
            <Button key="back" onClick={() => this.btcancel1()}>
              关闭
            </Button>
          ]}
        >
          服务商类型、总裁星级、所属总部、所属事业部只能有一个身份请确认后重新提交。
        </Modal>
      </Spin>
    )
  }
})
